#include <iostream>
#include <vector>
#include <random>
#include <algorithm>

std::string s, tt;
std::vector<std::pair<int, int>> pos;
char color(int i, int j) {
  if (i % 3 == 0 || j % 3 == 0) {
    if (i % 3 == 0 && j % 3 == 0) {
      return '#';
    }
    return tt[0];
  }
  int x = i / 3, y = j / 3;
  int xx = (i - 1) % 3, yy = (j - 1) % 3;
  if (x & 1) {
    return tt["1212"[xx * 2 + yy] - '0'];
  }
  return tt["2121"[xx * 2 + yy] - '0'];
}

std::mt19937 rng(0x3b800001);
long long f(int x) { return 1LL * x * x; }
long long dis(std::pair<int, int> p, std::pair<int, int> q) { return f(std::abs(p.first - q.first)) + f(std::abs(p.second - q.second)); }

int test(bool out = false) {
  std::pair<int, int> Xlr, Ylr;
  for (int i = 2999999; i <= 3000001; ++i) {
    if (color(3000001, i) == s[0]) {
      Xlr = {3000001, 3000001}, Ylr = {i, i};
      pos.push_back({3000001, i});
    }
  }
  for (int i = 1; i < int(s.size()); ++i) {
    int x = pos[i - 1].first, y = pos[i - 1].second;
    int nx = -1, ny = -1;
    for (auto [xx, yy] : std::vector<std::pair<int, int>>{{x - 1, y}, {x, y - 1}, {x, y + 1}, {x + 1, y}}) {
      if (color(xx, yy) == s[i]) {
        if (nx == -1 || dis({xx, yy}, pos[0]) < dis({nx, ny}, pos[0])) {
          nx = xx, ny = yy;
        }
      }
    }
    pos.push_back({nx, ny});
    Xlr.first = std::min(Xlr.first, nx), Xlr.second = std::max(Xlr.second, nx);
    Ylr.first = std::min(Ylr.first, ny), Ylr.second = std::max(Ylr.second, ny);
  }
  if (!out) {
    return std::max(Xlr.second - Xlr.first + 1, Ylr.second - Ylr.first + 1);
  }
  std::cout << Xlr.second - Xlr.first + 1 << ' ';
  std::cout << Ylr.second - Ylr.first + 1 << '\n';
  for (int i = Xlr.first; i <= Xlr.second; ++i) {
    for (int j = Ylr.first; j <= Ylr.second; ++j) {
      if (color(i, j) == '#') {
        std::cout << tt[0];
      } else {
        std::cout << color(i, j);
      }
    }
    std::cout << '\n';
  }
  std::cout << pos[0].first - Xlr.first + 1 << ' ';
  std::cout << pos[0].second - Ylr.first + 1 << '\n';
  for (int i = 1; i < int(s.size()); ++i) {
    auto [x, y] = pos[i - 1];
    for (auto [xy, c] : std::vector<std::pair<std::pair<int, int>, char>>{{{x - 1, y}, 'U'}, {{x, y - 1}, 'L'}, {{x, y + 1}, 'R'}, {{x + 1, y}, 'D'}}) {
      if (xy == pos[i]) {
        std::cout << c;
      }
    }
  }
  std::cout << '\n';
  return std::max(Xlr.second - Xlr.first + 1, Ylr.second - Ylr.first + 1);
}

std::string tttt[6];
int ttt[6];

int main() {
  std::freopen("snake.in", "r", stdin);
  std::freopen("snake.out", "w", stdout);
  std::cin.tie(nullptr)->sync_with_stdio(false);
  std::cin >> s;
  tt = tttt[0] = "RGB", ttt[0] = test();
  tt = tttt[1] = "RBG", ttt[1] = test();
  tt = tttt[2] = "GRB", ttt[2] = test();
  tt = tttt[3] = "GBR", ttt[3] = test();
  tt = tttt[4] = "BRG", ttt[4] = test();
  tt = tttt[5] = "BGR", ttt[5] = test();
  int x = std::min_element(ttt, ttt + 6) - ttt;
  tt = tttt[x];
  test(true);
  return 0;
}